import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import Workplace from './Workplace';

class App extends PureComponent {
    componentDidMount() {
        this.props.queryInitDate();
    }

    render() {
        return (
            <div
                style={{
                    marginTop: '24px'
                }}>
                <Workplace />
            </div>
        );
    }
}

App.propTypes = {
    queryInitDate: PropTypes.func
};
import {connect} from 'react-redux';
import * as actions from './actions.js';

const mapDispatchToProps = dispatch => ({
    queryInitDate: () => {
        dispatch(actions.getInitData());
    }
});

export default connect(
    null,
    mapDispatchToProps
)(App);
